package com.swift.maintenance.base;

import android.os.Environment;

import com.swift.base.ApplicationBase;
import com.swift.maintenance.R;

import java.util.ArrayList;
import java.util.List;

public final class AppConfig {

//	 public static final String TEXT_HOST = "http://test.jyfire.cn/";
	public static final String TEXT_HOST = "http://m.jyfire.cn/";
//	public static final String TEXT_HOST = "http://xf.tutew.com/";
	// 吴思桥的接口IP
//	 public static final String TEXT_HOST = "http://192.168.1.18/";

	public static final String IOT_HOST = "http://192.168.1.79:8980/";

	public static final String DB_NAME = "maintenance.db3";
	// 正式版本的后端IP
	public static final String REMOTE_HOST = "http://admin.jyfire.cn";

	public static final String UPLOAD_TASK_PATH = REMOTE_HOST
			+ "/Application/Maintenance/Upload/TaskAttachment/";
	public static final String API_GET_TASK_COMPANY_URL = "/getTaskCompany";
	public static final String API_GET_COMPANY_DATA_URL = "/getCompanyData";
	public static final String API_POST_TASK_URL = "/uploadTask";
	public static final String PAI_POST_SING = "/ajax_sign";
	public static final String API_POST_FAULT_URL = "/uploadFault";
	public static final String API_GET_TASK_URL = "/getTask";
	public static final String ABOUTUS_URL = REMOTE_HOST + "/Publish/aboutus";
	public static final String LOCAL_DATA = "local_data";
	public static final String BAIDU_PUSH_APIKEY = "KamwnWTDSbFmvYzQ3lGugmL3";
	public final static int SCANNIN_GREQUEST_CODE = 1001;
	public static final int CAPTURE_VIDEO_ACTIVITY_REQUEST_CODE = 1002;
	public static final int TASKDETAIL_ACTIVITY_REQUEST_CODE = 1003;
	public static final int TASKSPOT_ACTIVITY_REQUEST_CODE = 1004;
	public static final int REPAIR_ACTIVITY_REQUEST_CODE = 1005;
	public static final String SYSTEM_UPDATE_TIME = "system_update_time";
	public static final String COMPANY_UPDATE_TIME = "company_update_time";
	public static final String COMPANY_TASK_UPDATE_TIME = "task_update_time";
	public static final String COMPANY_ID_KEY = "company_id";
	public static final String JSON_COMPANYS_KEY = "companys";
	public static final String JSON_USERS_KEY = "users";
	public static final String EQUIPMENT_KEY = "equipment_id";
	public static final String IS_SPOTCHECK = "is_spotcheck";// 是否抽检
	public static final String EQUIPMENT_DETAIL_KEY = "equipment_list_id";
	public static final String INSPECTION_KEY = "inspection_id";
	public static final String TASK_INSPECTION_KEY = "task_inspection_id";
	public static final String CONTENT_KEY = "content";
	public static final String RECORD_KEY = "record";
	public static final String VERSION_URL = REMOTE_HOST + "/Publish/version";
	public static final String COMPANY_FUNC = "company_func";

	/**
	 * 登录的人员角色 ----------------------
	 */
	// 机构管理层 -- 监管的领导
	public static final int ORG_MNG = 1;
	// 项目管理层-- 业主的领导
	public static final int PROJECT_MNG = 2;
	// 项目员工层 -- 业主的员工
	public static final int PROJECT_EMP = 3;
	// 机构领导层 -- 搞不懂和 机构管理层的区别
	public static final int ORG_LEADER = 4;
	// 维保单位领导层 -- 维保领导层
	public static final int MTN_UNIT_LEADER = 5;
	// 超级用户 -- ADMIN
	public static final int SUPER_USER = 6;
	// 维保单位技术员 -- 维保员工
	public static final int MTN_UNIT_EMP = 7;
	// 普通用户
	public static final int GENERAL_USER = 9;
	// 录入员
	public static final int DATA_INPUT_USER = 12;

	/**
	 * ---------------------- 登录的人员角色
	 */

	/**
	 * 共享数据key ----------------------
	 */
	// 用户角色共享数据
	public static final String USER_ROLE = "user_role";
	// 用户token共享数据
	public static final String ACCESS_TOKEN = "access_token";
	// 用户维保单位id
	public static final String DEPART_ID = "depart_id";
	// 用户是否记住账号共享数据
	public static final String IS_REM = "input.remember";
	// 用户账号共享数据
	public static final String USER_ACCOUNT = "input.user";
	// 用户账号共享数据
	public static final String USER_NAME = "name";
	// 用户密码共享数据
	public static final String USER_PWD = "input.password";
	// 用户id共享数据
	public static final String USER_ID = "user_id";
	// 公司名称共享数据
	public static final String COMPANY_NAME = "company_name";
	// 平台类型
	public static final String DEPART_TYPE = "depart_type";
	// 监管的角色
	public static final String SUPERVISION_ROLE = "supervision_role";
	// 平台名称
	public static final String DEPART_NAME = "depart_name";
	// 用户头像
	public static final String USER_LOGO = "user_logo";
	// 调查权限
	public static final String ACCESS = "access";

	/**
	 * ---------------------- 共享数据key
	 */

	// 默认的日期格式
	public static final String DATE_FORMIT = "yyyy-MM-dd HH:mm:ss";
	public static final String ROOT_PATH  = Environment
			.getExternalStorageDirectory().getPath();
	// 默认的存放文件路径
	public static final String APP_DIR = Environment
			.getExternalStorageDirectory() + "/jiyi/";
	// 默认的存放图片路径
	public static final String DIR_IMAGE = APP_DIR + "images/";
	// 默认的存放安装包路径
//	public static final String DIR_APK = APP_DIR + "apk/";
	public static final String DIR_APK = Environment
			.getExternalStorageDirectory() +"/apk/";
	// 默认的存放文件路径
	public static final String DIR_DOC = ROOT_PATH + "/jiyi/doc/";
	// 抽检时选择的参与人员列表
	public static List<String> JoinMemberIdsList = new ArrayList<String>();
	// 图片加载占位图片
	public static int PIC_PALACE = R.mipmap.ic_launcher;
	public static final int DET_RELOAD = 16;

	// 系统本地数据最后更新时间
	public static int getSystemUpdateTime() {
		return ApplicationBase.LocalData.getInt(SYSTEM_UPDATE_TIME, 0);
	}

	public static void SetSystemUpdateTime(int value) {
		ApplicationBase.LocalData.edit().putInt(SYSTEM_UPDATE_TIME, value)
				.commit();
	}

	// 当前选择的公司
	public static int getSelectCompanyId() {
		return ApplicationBase.LocalData.getInt(JSON_COMPANYS_KEY, 0);
	}

	public static void setSelectCompanyId(int value) {
		ApplicationBase.LocalData.edit().putInt(JSON_COMPANYS_KEY, value)
				.commit();
	}

	// 微信api
	public static final String APP_ID = "wxebeccbdc5ffce53d";
	// 最大的活动数量
	public static final int max_huodong = 30;
	// 检测系统的父节点position
	public static int detectParentPosition = -1;
	// 检测系统的子节点position
	public static int detectChildPosition = -1;

	// 逃生定位，默认的点位点
	public static double escape_lat = 24.554488;
	public static double escape_lgn = 118.130723;




}
